﻿using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SDPChecker;

namespace SPDChecker.Tests
{
    [TestClass]
    public class CqlResultParserTests
    {
        private List<AssemblyInfo> _assemblies;

        [TestInitialize]
        public void Initialize()
        {
            _assemblies = new CqlResultParser(new StringReader(Resources.CQLResult)).InstableAssemblies.ToList();
        }


        [TestMethod]
        public void TestInstableAssemblies()
        {            
            Assert.AreEqual(16, _assemblies.Count, "Number of assemblies with instability number");
            Assert.AreEqual("MyProject.Domain", _assemblies[0].Name, "First assembly is not named right");
            Assert.AreEqual(0.21081M, _assemblies[0].Value, "First assembly's value");
        }
    }
}
